package lab02.test21;

import java.util.Scanner;

public interface Test {
    public static void main(String[] args) {
        //输入字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String str = sc.nextLine();

        char[] arr = str.toCharArray();
        int number =0;

        for (int i = 0;i < arr.length;i++){
            if (arr[i]=='a'){
                number++;
            }
        }
        System.out.println("字符‘a’出现的频率为："+number);
    }
}
